/*
 * GraphEdge.h
 *
 *  Created on: 14/11/2011
 *      Author: will
 */

#ifndef GRAPHEDGE_H_
#define GRAPHEDGE_H_

#include <vector>
#include <eigen3/Eigen/Core>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/array.hpp>
#include "mex.h"

class GraphNode;
class Particle;

using std::vector;
using Eigen::Vector3d;
using Eigen::Matrix3d;

class GraphEdge {
public:
	GraphEdge();
	virtual ~GraphEdge();
	GraphEdge(const GraphEdge & other);
	GraphEdge & operator=(const GraphEdge & other);

	// Location
	unsigned int frameNum;
	Vector3d odometry;
	Matrix3d icov;
	GraphNode* nodeFrom;
	GraphNode* nodeTo;

	// Data Storage
	vector<Particle*> particles;

	// Serialization
	friend class boost::serialization::access;
		template<class Archive>
		void serialize(Archive &ar, const unsigned int version) {

			mexPrintf("SERIALIZATION: Processing GraphEdge\n");

			ar & BOOST_SERIALIZATION_NVP(frameNum);
			ar & BOOST_SERIALIZATION_NVP(odometry);
			ar & BOOST_SERIALIZATION_NVP(icov);
			ar & BOOST_SERIALIZATION_NVP(nodeFrom);
			ar & BOOST_SERIALIZATION_NVP(nodeTo);
			ar & BOOST_SERIALIZATION_NVP(particles);
		}

};

#endif /* GRAPHEDGE_H_ */
